﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TimViec
{
    public partial class Contact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btSend_Click(object sender, EventArgs e)
        {
                        
            string email = System.Configuration.ConfigurationManager.AppSettings["mail"];
            string MK = System.Configuration.ConfigurationManager.AppSettings["mailpassword"];

            string noidung = "-Họ tên: <b>" + txtHoten.Text + "</b><br/>"
                             + "-Email: " + txtEmail.Text + "<br/>"
                             + "-Nội dung: " + txtNoiDung.Text;
            MailHelper.SendMail1(email, "Email liên hệ: "+txtTieuDe.Text, noidung, email, MK);
            txtEmail.Text = "";
            txtHoten.Text = "";
            txtTieuDe.Text = "";
            txtNoiDung.Text = "";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "redirectMe", "alert('Thư của bạn đã gửi thư tới hệ thống!');", true);
        }
    }
}